package com.example.demo.service.impl;

import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> selectUser(){
        List<User> users=userMapper.selectUser();
        return users;
    }

    @Override
    public String selectById(String id) {
        return userMapper.selectById(id);
    }

    @Override
    public User selectById1(String id) {
        return userMapper.selectById1(id);
    }

    @Override
    public void insertUser(User user) {
        userMapper.insertUser(user);
    }

    @Override
    public String selectBalance(String id) {
        return userMapper.selectBalance(id);
    }

    @Override
    public void updateBalance(String money, String id) {
        userMapper.updateBalance(money,id);
    }

    @Override
    public void updateBalance1(String money, String id) {
        userMapper.updateBalance1(money,id);
    }

    @Override
    public void updatePw(String pw,String id) {
        userMapper.updatePw(pw,id);
    }

    @Override
    public int selectPower(String id) {
        return userMapper.selectPower(id);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public void delUser(String id) {
        userMapper.delUser(id);
    }

    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }

    @Override
    public void updateUserInfo(User user) {
        userMapper.updateUserInfo(user);
    }
}
